/*
*/

#ifndef __FORM_H
#define __FORM_H

#ifndef	__SYSTEM_H
#include "system.h"
#endif

#define	DEV_0		0
#define	DEV_1		1
#define	DEV_2		2
#define	DEV_3		3
#define	DEV_PANA	4
#define	DEV_SWDVD	5
#define	DEV_TCL		6
#define	DEV_YAMA	7

#define	FORM_083	1
#define	FORM_443	2
#define	FORM_843	3
#define	FORM_883	4
#define	FORM_00		5
#define	FORM_ITT	6
#define	FORM_JVC	7
#define	FORM_NRC17	8
#define	FORM_RC5	9
#define	FORM_RC6	10
#define	FORM_RCA	11
#define	FORM_RCMM	12
#define	FORM_RECS80	13
#define	FORM_SHARP	14
#define	FORM_SIRC	15
#define	FORM_XSAT	16
#define	FORM_FORM	255

#define	SLOT_BURR	1
#define	SLOT_LO		2
#define	SLOT_LO1	3
#define	SLOT_LO2	4
#define	SLOT_LO3	5
#define	SLOT_LO4	6
#define	SLOT_LO5	7
#define	SLOT_HI		8
#define	SLOT_HI1	9
#define	SLOT_HI2	10
#define	SLOT_HI3	11
#define	SLOT_HI4	12
#define	SLOT_HI5	13
#define	SLOT_LEN	14

typedef struct _SLOT{
    U32	count;
    U32	fact;
    U32	period;
    U32	sum;
}SLOT;

U32	Decode	(BEAM*,KEY*,SLOT*);
U32	Encode	(BEAM*,KEY*);
U32	Fact	(BEAM*,SLOT*);
void	Load	(U32,KEY*,U32,U32);

#endif
